
// 45.8  43.86
// 52.7  45.7

console.log(
    getPoint("攻击力", "9.9%")+
    getPoint("暴击率", "5.8%")+
    getPoint("暴击伤害", "24.9%")
);

function getPoint(key, info) {
    if(key == "暴击伤害"){
        return info.replace("%", "") - 0
    } 
    if(key == "暴击率"){
        return (info.replace("%", "") - 0) * 2
    } 
    if(key == "攻击力"){
        if(/%/.test(info)) {
            return (info.replace("%", "") - 0) * (62.2/46.6)
        } else {
            let at = info - 0;
            if(!Number.isNaN(at)) {
                return at/9.45 * (62.2/46.6)
            }
        }
    } 
    if(key == "元素精通"){
        let reaction = info - 0;
        if(!Number.isNaN(reaction)) {
            return (278*reaction/(reaction+1400)) * (62.2/46.6)
        }
    } 
    if(key == "元素充能效率"){
        return info.replace("%", "") - 0;
    } 
}